xsltData = {
	'unit': {
		'name': 'unit',
		'xslturl': '../../../../bin/kernel.py?func=unitlist',
		'xmlurl': '../../xslt/unit-list.xsl'
	},
	'mspdialog': {
		'name': 'mspdialog',
		'xslturl': '../../../../bin/kernel.py?func=msplist',
		'xmlurl': '../../xslt/msp-table.xsl',
	},
	'currency': {
		'name': 'currency',
		'xslturl': '../../../../bin/kernel.py?func=currencylist',
		'xmlurl': '../../xslt/currency-list.xsl'
	},
	'model': {
		'name': 'model',
		'xslturl': '../../../../bin/kernel.py?func=modellist',
		'xmlurl': '../../xslt/model-list.xsl'
	},
	'mrtmodel': {
		'name': 'mrtmodel',
		'xslturl': '../../../../bin/kernel.py?func=modellist',
		'xmlurl': '../../xslt/model-select.xsl'
	},
	'spcode': {
		'name': 'spcode',
		'xslturl': '../../../../bin/kernel.py?func=spcode',
		'xmlurl': '../../xslt/spcode-list.xsl'
	},
	'spcodetable': {
		'name': 'spcodetable',
		'xslturl': '../../../../bin/kernel.py?func=spcodetable',
		'xmlurl': '../../xslt/spcode-table.xsl'
	},
	'rtcodetable': {
		'name': 'rtcodetable',
		'xslturl': '../../../../bin/kernel.py?func=rtcodetable',
		'xmlurl': '../../xslt/rtcode-table.xsl'
	},
	'spcodetablefull': {
		'name': 'spcodetablefull',
		'xslturl': '../../../../bin/kernel.py?func=spcodetablefull',
		'xmlurl': '../../xslt/spcodefull-table.xsl'
	},
	'customergroup': {
		'name': 'customergroup',
		'xslturl': '../../../../bin/kernel.py?func=getCustomerGroup',
		'xmlurl': '../../xslt/customergroup-list.xsl'
	},
	'drepairtype': {
		'name': 'drepairtype',
		'xslturl': '../../../../bin/kernel.py?func=getRepairType',
		'xmlurl': '../../xslt/drepairtype-table.xsl'
	},
	'dcustomer': {
		'name': 'dcustomer',
		'xslturl': '../../../../bin/kernel.py?func=getCustomer',
		'xmlurl': '../../xslt/customer-table.xsl'
	},
	'dmodel': {
		'name': 'dmodel',
		'xslturl': '../../../../bin/kernel.py?func=getDModel',
		'xmlurl': '../../xslt/dmodel-table.xsl'
	},
	'ddestination': {
		'name': 'dcustomer',
		'xslturl': '../../../../bin/kernel.py?func=getDDestination',
		'xmlurl': '../../xslt/ddestination-table.xsl'
	},
	'transaction': {
		'name': 'transaction',
		'xslturl': '../../../../bin/kernel.py?func=getTransactionType',
		'xmlurl': '../../xslt/transaction-list.xsl'
	},
	'ptbydatetable': {
		'name': 'ptbydatetable',
		'xslturl': '../../../../bin/kernel.py?func=getTransactionByDate',
		'xmlurl': '../../xslt/ptbydate-table.xsl'
	},
	'ptbydatedetailtable': {
		'name': 'ptbydatedetailtable',
		'xslturl': '../../../../bin/kernel.py?func=getTransactionByDateDetail',
		'xmlurl': '../../xslt/ptbydate-table.xsl'
	},
	'ptbyitemtable': {
		'name': 'ptbyitemtable',
		'xslturl': '../../../../bin/kernel.py?func=getTransactionByDate',
		'xmlurl': '../../xslt/ptbyitem-table.xsl'
	},
	'inventorybydate': {
		'name': 'inventorybydate',
		'xslturl': '../../../../bin/kernel.py?func=getWarehouseInventoryByDate',
		'xmlurl': '../../xslt/inventorybydate-table.xsl'
	},
	'inventorybyitem': {
		'name': 'inventorybyitem',
		'xslturl': '../../../../bin/kernel.py?func=getWarehouseInventoryByItem',
		'xmlurl': '../../xslt/inventorybyitem-table.xsl'
	},
	'zeroquantity': {
		'name': 'zeroquantity',
		'xslturl': '../../../../bin/kernel.py?func=getZeroQuantity',
		'xmlurl': '../../xslt/zeroquantity-table.xsl'
	},
	'customerlist': {
		'name': 'customerlist',
		'xslturl': '../../../../bin/kernel.py?func=getCustomer',
		'xmlurl': '../../xslt/customer-list.xsl'
	},
	'destinationlist': {
		'name': 'destinationlist',
		'xslturl': '../../../../bin/kernel.py?func=getDDestination',
		'xmlurl': '../../xslt/destination-list.xsl'
	},
	'repairtypelist': {
		'name': 'repairtypelist',
		'xslturl': '../../../../bin/kernel.py?func=getRepairType',
		'xmlurl': '../../xslt/repairtype-list.xsl'
	},
	'repairtypelistfilter': {
		'name': 'repairtypelist',
		'xslturl': '../../../../bin/kernel.py?func=getRepairTypeFilter',
		'xmlurl': '../../xslt/repairtype-list.xsl'
	},
	'repairnotetable': {
		'name': 'repairnotetable',
		'xslturl': '../../../../bin/kernel.py?func=getRepairNoteTable',
		'xmlurl': '../../xslt/repairnotetable.xsl'
	},
	'PRNbC': {
		'name': 'PRNbC',
		'xslturl': '../../../../bin/kernel.py?func=getRepairNoteTableReport',
		'xmlurl': '../../xslt/PRNbC.xsl'
	},
	'PRNbRD': {
		'name': 'PRNbRD',
		'xslturl': '../../../../bin/kernel.py?func=getRepairNoteTableReport',
		'xmlurl': '../../xslt/PRNbRD.xsl'
	},
	'PRNbRN': {
		'name': 'PRNbRN',
		'xslturl': '../../../../bin/kernel.py?func=getRepairNoteTableReport',
		'xmlurl': '../../xslt/PRNbRN.xsl'
	},
	'PRNbDD': {
		'name': 'PRNbDD',
		'xslturl': '../../../../bin/kernel.py?func=getRepairNoteTableReport',
		'xmlurl': '../../xslt/PRNbDD.xsl'
	},
	'PRNbDN': {
		'name': 'PRNbDN',
		'xslturl': '../../../../bin/kernel.py?func=getRepairNoteTableReport',
		'xmlurl': '../../xslt/PRNbDN.xsl'
	},
	'PRNbD': {
		'name': 'PRNbD',
		'xslturl': '../../../../bin/kernel.py?func=getRepairNoteTableReport',
		'xmlurl': '../../xslt/PRNbD.xsl'
	},
	'PRNbM': {
		'name': 'PRNbM',
		'xslturl': '../../../../bin/kernel.py?func=getRepairNoteTableReport',
		'xmlurl': '../../xslt/PRNbM.xsl'
	},
	'PRNbSN': {
		'name': 'PRNbSN',
		'xslturl': '../../../../bin/kernel.py?func=getRepairNoteTableReport',
		'xmlurl': '../../xslt/PRNbSN.xsl'
	},
	'PRNbRT': {
		'name': 'PRNbRT',
		'xslturl': '../../../../bin/kernel.py?func=getRepairNoteTableReport',
		'xmlurl': '../../xslt/PRNbRT.xsl'
	},
	'dpricestable': {
		'name': 'dpricestable',
		'xslturl': '../../../../bin/kernel.py?func=getGPrices',
		'xmlurl': '../../xslt/dprices-table.xsl'
	},
	'PDIbPtable': {
		'name': 'PDIbPtable',
		'xslturl': '../../../../bin/kernel.py?func=getPrintDetailedInvoicebyPeriod',
		'xmlurl': '../../xslt/PDIbP-table.xsl'
	},
	'PIbMtable': {
		'name': 'PIbMtable',
		'xslturl': '../../../../bin/kernel.py?func=getModelRepairCount',
		'xmlurl': '../../xslt/PIbM-table.xsl'
	},
	'rnote': {
		'name': 'rnote',
		'xslturl': '../../../../bin/kernel.py?func=getRNote',
		'xmlurl': '../../xslt/rnote-select.xsl'
	},
	'PIbRTtable': {
		'name': 'PIbRTtable',
		'xslturl': '../../../../bin/kernel.py?func=getPrintInvoicebyRepairType',
		'xmlurl': '../../xslt/PIbRT-table.xsl'
	},
	'POSPpRNtable': {
		'name': 'POSPpRNtable',
		'xslturl': '../../../../bin/kernel.py?func=getPrintOtherSparePartsperRepairNote',
		'xmlurl': '../../xslt/POSPpRN-table.xsl'
	},
	'PRNNtable': {
		'name': 'PRNNtable',
		'xslturl': '../../../../bin/kernel.py?func=getPrintRepairNoteNumber',
		'xmlurl': '../../xslt/PRNN-table.xsl'
	},
	'coolerinventory': {
		'name': 'coolerinventory',
		'xslturl': '../../../../bin/kernel.py?func=getCoolerInventory',
		'xmlurl': '../../xslt/coolerinventory-table.xsl'
	},
	'coolerinventorydel': {
		'name': 'coolerinventorydel',
		'xslturl': '../../../../bin/kernel.py?func=getCoolerInventory',
		'xmlurl': '../../xslt/coolerinventorydel-table.xsl'
	},
	'printsparepartsorder': {
		'name': 'printsparepartsorder',
		'xslturl': '../../../../bin/kernel.py?func=getSPNeedOrder',
		'xmlurl': '../../xslt/printsparepartsorder-table.xsl'
	},
	'orderedsp': {
		'name': 'orderedsp',
		'xslturl': '../../../../bin/kernel.py?func=getOrderedSPTable',
		'xmlurl': '../../xslt/printorderedsp-table.xsl'
	},
	'closeorderedsp': {
		'name': 'closeorderedsp',
		'xslturl': '../../../../bin/kernel.py?func=getCloseOrderedSPTable',
		'xmlurl': '../../xslt/printclosedordersp-table.xsl'
	},
	'closeorder': {
		'name': 'closeorder',
		'xslturl': '../../../../bin/kernel.py?func=getOrderedSPTable',
		'xmlurl': '../../xslt/closeorder-table.xsl'
	},
	'snumberlist': {
		'name': 'snumberlist',
		'xslturl': '../../../../bin/kernel.py?func=getCoolerSNFromCoolerReceipt',
		'xmlurl': '../../xslt/snumber-list.xsl'
	}
}

timeout = 300

dialogData = {
	'debugdialog':{
		'title':	'Debug Dialog',
		'name':		'debugdialog',
		'created':	false,
		'dialogurl':'./iframe/test.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			open:		function (event, ui) {
				$('#debugdialogframe')[0].src = dialogData.debugdialog.dialogurl;
				dialogName = dialogData.debugdialog.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('debugdialog');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.debugdialog.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.debugdialog.name);
			}

		}
	},
	'mspdialog': {
		'title': 	'Spare Parts',
		'name': 	'mspdialog',
		'created': 	false,
		'dialogurl':'./iframe/mspdialog.html',
		'dialogSize':	{
			'width':	900,
			'top': 		0,
			'height':	300,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			open:		function (event, ui) {
				$('#mspdialogframe')[0].src = dialogData.mspdialog.dialogurl;
				dialogName = dialogData.mspdialog.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('mspdialog');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.mspdialog.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.mspdialog.name);
			}
		}
	},
	'mainmenudialog': {
		'title': 		'Main menu dialog',
		'name': 		'mainmenudialog',
		'created': 		false,
		'dialogurl':	'./iframe/mainMenu0.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			open:		function (event, ui) {
				$('#mainmenudialogframe')[0].src = dialogData.mainmenudialog.dialogurl;
				dialogName = dialogData.mainmenudialog.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('mainmenudialog');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.mainmenudialog.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.mainmenudialog.name);
			}
		}
	},
	'mspformdialog': {
		'title': 	'Maintain Spare Parts',
		'name': 	'mspformdialog',
		'created': 	false,
		'dialogurl':	'./iframe/mspform.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			open:		function (event, ui) {
				$('#mspformdialogframe')[0].src = dialogData['mspformdialog']['dialogurl'];
				dialogName = dialogData['mspformdialog']['name'];
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('mspformdialog');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData['mspformdialog']['name']);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData['mspformdialog']['name']);
			}
		}
	},
	'modelform': {
		'title': 	'Add model',
		'name': 	'modelform',
		'created': 	false,
		'dialogurl':	'./iframe/modelform.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'scrolling':	'no',
		'param':	{
			autoOpen:	true,
			minHeight:	40,
			open:		function (event, ui) {
				$('#modelformframe')[0].src = dialogData.modelform.dialogurl;
				dialogName = dialogData.modelform.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('modelform');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.modelform.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.modelform.name);
			}
		}
	},
	'unitform': {
		'title': 	'Add unit',
		'name': 	'unitform',
		'created': 	false,
		'dialogurl':	'./iframe/unitform.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'scrolling':	'no',
		'param':	{
			autoOpen:	true,
			minHeight:	40,
			open:		function (event, ui) {
				$('#unitformframe')[0].src = dialogData.unitform.dialogurl;
				dialogName = dialogData.unitform.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('unitform');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.unitform.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.unitform.name);
			}
		}
	},
	'currencyform': {
		'title': 	'Add currency',
		'name': 	'currencyform',
		'created': 	false,
		'dialogurl':	'./iframe/currencyform.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'scrolling':	'no',
		'param':	{
			autoOpen:	true,
			minHeight:	40,
			open:		function (event, ui) {
				$('#currencyformframe')[0].src = dialogData.currencyform.dialogurl;
				dialogName = dialogData.currencyform.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('currencyform');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.currencyform.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.currencyform.name);
			}
		}
	},
	'uploadcsv': {
		'title': 	'Upload spare parts',
		'name': 	'uploadcsv',
		'created': 	false,
		'dialogurl':	'./iframe/uploadcsv.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#uploadcsvframe')[0].src = dialogData.uploadcsv.dialogurl;
				dialogName = dialogData.uploadcsv.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('uploadcsv');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.uploadcsv.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.uploadcsv.name);
			}
		}
	},
	'mrtform': {
		'title': 	'Maintain Repair Type',
		'name': 	'mrtform',
		'created': 	false,
		'dialogurl':	'./iframe/mrtform.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#mrtformframe')[0].src = dialogData.mrtform.dialogurl;
				dialogName = dialogData.mrtform.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('mrtform');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.mrtform.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.mrtform.name);
			}
		}
	},
	'RTConsumption': {
		'title': 	'Repair Type Consumption',
		'name': 	'RTConsumption',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/RTConsumption.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#RTConsumptionframe')[0].src = dialogData.RTConsumption.dialogurl +
					'?id=' + dialogData.RTConsumption.getid;
				dialogName = dialogData.RTConsumption.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('RTConsumption');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.RTConsumption.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.RTConsumption.name);
			}
		}
	},
    'SPConsumption': {
	'title':'Spare Parts Consumption',
	'name': 'SPConsumption',
	'getid': '',
	'created': false,
	'dialogurl': './iframe/SPConsumption.html',
	'dialogSize': {
	    'width': 230,
	    'top': 0,
	    'height': 200,
	    'left': 0
	},
	'param': {
	    autoOpen: true,
	    minHeight: 60,
	    open: function (event, ui) {
		$('#SPConsumptionframe')[0].src = dialogData.SPConsumption.dialogurl +
		    '?id=' + dialogData.SPConsumption.getid;
		dialogName = dialogData.SPConsumption.name;
		getDialogSize(getUserId(), dialogName);
		window.setTimeout("updateDialog('SPConsumption');", timeout);
	    },
	    dragStop: function(event, ui) {
		updateSize(dialogData.SPConsumption.name);
	    },
	    resizeStop: function(event, ui) {
		updateSize(dialogData.SPConsumption.name);
	    }
	}
    },
    'SPConsumption2': {
	'title':'Spare Parts Consumption',
	'name': 'SPConsumption',
	'getid': '',
	'created': false,
	'dialogurl': './iframe/SPConsumption.html',
	'dialogSize': {
	    'width': 230,
	    'top': 0,
	    'height': 200,
	    'left': 0
	},
	'param': {
	    autoOpen: true,
	    minHeight: 60,
	    open: function (event, ui) {
		$('#SPConsumption2frame')[0].src = dialogData.SPConsumption.dialogurl +
		    '?id=' + dialogData.SPConsumption.getid2;
		dialogName = dialogData.SPConsumption.name;
		getDialogSize(getUserId(), dialogName);
		window.setTimeout("updateDialog('SPConsumption');", timeout);
	    },
	    dragStop: function(event, ui) {
		updateSize(dialogData.SPConsumption.name);
	    },
	    resizeStop: function(event, ui) {
		updateSize(dialogData.SPConsumption.name);
	    }
	}
    },
	'customer': {
		'title': 	'Maintain Customer',
		'name': 	'customer',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/customer.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#customerframe')[0].src = dialogData.customer.dialogurl
				dialogName = dialogData.customer.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('customer');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.customer.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.customer.name);
			}
		}
	},
	'groupform': {
		'title': 	'Add customer group',
		'name': 	'groupform',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/customergroupform.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#groupformframe')[0].src = dialogData.groupform.dialogurl
				dialogName = dialogData.groupform.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('groupform');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.groupform.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.groupform.name);
			}
		}
	},
	'destinationform': {
		'title': 	'Add destination',
		'name': 	'destinationform',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/destinationform.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#destinationformframe')[0].src = dialogData.destinationform.dialogurl
				dialogName = dialogData.destinationform.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('destinationform');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.destinationform.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.destinationform.name);
			}
		}
	},
	'pricingform': {
		'title': 	'Maintain Pricing',
		'name': 	'pricingform',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/pricingform.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#pricingformframe')[0].src = dialogData.pricingform.dialogurl
				dialogName = dialogData.pricingform.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('pricingform');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.pricingform.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.pricingform.name);
			}
		}
	},
	'displayform': {
		'title': 	'Display Data',
		'name': 	'displayform',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/displayform.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#displayformframe')[0].src = dialogData.displayform.dialogurl
				dialogName = dialogData.displayform.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('displayform');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.displayform.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.displayform.name);
			}
		}
	},
	'drepairtype': {
		'title': 	'Display Repair Types',
		'name': 	'drepairtype',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/drepairtype.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#drepairtypeframe')[0].src = dialogData.drepairtype.dialogurl
				dialogName = dialogData.drepairtype.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('drepairtype');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.drepairtype.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.drepairtype.name);
			}
		}
	},
	'dcustomer': {
		'title': 	'Display Customers',
		'name': 	'dcustomer',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'extjs',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				// $('#dcustomerframe')[0].src = dialogData.dcustomer.dialogurl
				// dialogName = dialogData.dcustomer.name;
				// getDialogSize(getUserId(), dialogName);
				// window.setTimeout("updateDialog('dcustomer');", timeout);
				Ext.create('RDB.view.window.DisplayCustomers');
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.dcustomer.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.dcustomer.name);
			}
		}
	},
	'dprices': {
		'title': 	'Display Prices',
		'name': 	'dprices',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/dprices.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#dpricesframe')[0].src = dialogData.dprices.dialogurl
				dialogName = dialogData.dprices.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('dprices');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.dprices.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.dprices.name);
			}
		}
	},
	'dmodel': {
		'title': 	'Display Models',
		'name': 	'dmodel',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/dmodel.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#dmodelframe')[0].src = dialogData.dmodel.dialogurl
				dialogName = dialogData.dmodel.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('dmodel');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.dmodel.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.dmodel.name);
			}
		}
	},
	'ddestination': {
		'title': 	'Display Destinations',
		'name': 	'ddestination',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/ddestination.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#ddestinationframe')[0].src = dialogData.ddestination.dialogurl
				dialogName = dialogData.ddestination.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('ddestination');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.ddestination.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.ddestination.name);
			}
		}
	},
	'dspbyrepairtype': {
		'title': 	'Display Spare Parts by Repair Type',
		'name': 	'dspbyrepairtype',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/dspbyrepairtype.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#dspbyrepairtypeframe')[0].src = dialogData.dspbyrepairtype.dialogurl
				dialogName = dialogData.dspbyrepairtype.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('dspbyrepairtype');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.dspbyrepairtype.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.dspbyrepairtype.name);
			}
		}
	},
	'inventoryadjustment': {
		'title': 	'Inventory Adjustment',
		'name': 	'inventoryadjustment',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/inventoryadjustment.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#inventoryadjustmentframe')[0].src = dialogData.inventoryadjustment.dialogurl
				dialogName = dialogData.inventoryadjustment.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('inventoryadjustment');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.inventoryadjustment.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.inventoryadjustment.name);
			}
		}
	},
	'transactiontype': {
		'title': 	'Maintain Transaction Type',
		'name': 	'transactiontype',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/transactionType.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#transactiontypeframe')[0].src = dialogData.transactiontype.dialogurl
				dialogName = dialogData.transactiontype.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('transactiontype');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.transactiontype.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.transactiontype.name);
			}
		}
	},
	'iareports': {
		'title': 	'Inquiries and Reports',
		'name': 	'iareports',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/iareports.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#iareportsframe')[0].src = dialogData.iareports.dialogurl
				dialogName = dialogData.iareports.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('iareports');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.iareports.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.iareports.name);
			}
		}
	},
	'ptbydate': {
		'title': 	'Print Transactions by Date',
		'name': 	'ptbydate',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/ptbydate.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#ptbydateframe')[0].src = dialogData.ptbydate.dialogurl
				dialogName = dialogData.ptbydate.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('ptbydate');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.ptbydate.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.ptbydate.name);
			}
		}
	},
	'ptbyitem': {
		'title': 	'Print Transactions by Item',
		'name': 	'ptbyitem',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/ptbyitem.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#ptbyitemframe')[0].src = dialogData.ptbyitem.dialogurl
				dialogName = dialogData.ptbyitem.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('ptbyitem');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.ptbyitem.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.ptbyitem.name);
			}
		}
	},
	'ptbytype': {
		'title': 	'Print Transactions by Type',
		'name': 	'ptbytype',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/ptbytype.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#ptbytypeframe')[0].src = dialogData.ptbytype.dialogurl
				dialogName = dialogData.ptbytype.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('ptbytype');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.ptbytype.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.ptbytype.name);
			}
		}
	},
	'inventorybydate': {
		'title': 	'Print Warehouse Inventory by Date',
		'name': 	'inventorybydate',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/inventorybydate.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#inventorybydateframe')[0].src = dialogData.inventorybydate.dialogurl
				dialogName = dialogData.inventorybydate.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('inventorybydate');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.inventorybydate.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.inventorybydate.name);
			}
		}
	},
	'inventorybyitem': {
		'title': 	'Print Warehouse Inventory by Item',
		'name': 	'inventorybyitem',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/inventorybyitem.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#inventorybyitemframe')[0].src = dialogData.inventorybyitem.dialogurl
				dialogName = dialogData.inventorybyitem.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('inventorybyitem');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.inventorybyitem.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.inventorybyitem.name);
			}
		}
	},
	'zeroquantity': {
		'title': 	'Print Items with Zero Quantity',
		'name': 	'zeroquantity',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/zeroquantity.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#zeroquantityframe')[0].src = dialogData.zeroquantity.dialogurl
				dialogName = dialogData.zeroquantity.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('zeroquantity');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.zeroquantity.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.zeroquantity.name);
			}
		}
	},
	'repairnote': {
		'title': 	'Maintain Repair Note',
		'name': 	'repairnote',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/repairnote.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#repairnoteframe')[0].src = dialogData.repairnote.dialogurl
				dialogName = dialogData.repairnote.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('repairnote');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.repairnote.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.repairnote.name);
			}
		}
	},
	'repairnotetable': {
		'title': 	'Modify Repair Note',
		'name': 	'repairnotetable',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/repairnotetable.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#repairnotetableframe')[0].src = dialogData.repairnotetable.dialogurl
				dialogName = dialogData.repairnotetable.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('repairnotetable');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.repairnotetable.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.repairnotetable.name);
			}
		}
	},
	'report': {
		'title': 	'Report',
		'name': 	'report',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/report.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#reportframe')[0].src = dialogData.report.dialogurl
				dialogName = dialogData.report.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('report');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.report.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.report.name);
			}
		}
	},
	'PRNbC': {
		'title': 	'Print Repair Notes by Customer',
		'name': 	'PRNbC',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/PRNbC.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#PRNbCframe')[0].src = dialogData.PRNbC.dialogurl
				dialogName = dialogData.PRNbC.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('PRNbC');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.PRNbC.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.PRNbC.name);
			}
		}
	},
	'PRNbRD': {
		'title': 	'Print Repair Notes by Repair Date',
		'name': 	'PRNbRD',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/PRNbRD.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#PRNbRDframe')[0].src = dialogData.PRNbRD.dialogurl
				dialogName = dialogData.PRNbRD.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('PRNbRD');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.PRNbRD.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.PRNbRD.name);
			}
		}
	},
	'PRNbRN': {
		'title': 	'Print Repair Notes by Repair Number',
		'name': 	'PRNbRN',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/PRNbRN.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#PRNbRNframe')[0].src = dialogData.PRNbRN.dialogurl
				dialogName = dialogData.PRNbRN.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('PRNbRN');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.PRNbRN.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.PRNbRN.name);
			}
		}
	},
	'PRNbDD': {
		'title': 	'Print Repair Notes by Dispatch Date',
		'name': 	'PRNbDD',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/PRNbDD.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#PRNbDDframe')[0].src = dialogData.PRNbDD.dialogurl
				dialogName = dialogData.PRNbDD.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('PRNbDD');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.PRNbDD.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.PRNbDD.name);
			}
		}
	},
	'PRNbDN': {
		'title': 	'Print Repair Notes by Dispatch Note',
		'name': 	'PRNbDN',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/PRNbDN.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#PRNbDNframe')[0].src = dialogData.PRNbDN.dialogurl
				dialogName = dialogData.PRNbDN.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('PRNbDN');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.PRNbDN.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.PRNbDN.name);
			}
		}
	},
	'PRNbD': {
		'title': 	'Print Repair Notes by Destination',
		'name': 	'PRNbD',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/PRNbD.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#PRNbDframe')[0].src = dialogData.PRNbD.dialogurl
				dialogName = dialogData.PRNbD.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('PRNbD');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.PRNbD.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.PRNbD.name);
			}
		}
	},
	'PRNbM': {
		'title': 	'Print Repair Notes by Model',
		'name': 	'PRNbM',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/PRNbM.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#PRNbMframe')[0].src = dialogData.PRNbM.dialogurl
				dialogName = dialogData.PRNbM.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('PRNbM');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.PRNbM.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.PRNbM.name);
			}
		}
	},
	'PRNbSN': {
		'title': 	'Print Repair Notes by Serial Number',
		'name': 	'PRNbSN',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/PRNbSN.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#PRNbSNframe')[0].src = dialogData.PRNbSN.dialogurl
				dialogName = dialogData.PRNbSN.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('PRNbSN');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.PRNbSN.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.PRNbSN.name);
			}
		}
	},
	'PRNbRT': {
		'title': 	'Print Repair Notes by Repair Type',
		'name': 	'PRNbRT',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/PRNbRT.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#PRNbRTframe')[0].src = dialogData.PRNbRT.dialogurl
				dialogName = dialogData.PRNbRT.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('PRNbRT');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.PRNbRT.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.PRNbRT.name);
			}
		}
	},
	'uploadpricegroup': {
		'title': 	'Upload pricing for group',
		'name': 	'uploadpricegroup',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/uploadPriceGroup.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#uploadpricegroupframe')[0].src = dialogData.uploadpricegroup.dialogurl
				dialogName = dialogData.uploadpricegroup.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('uploadpricegroup');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.uploadpricegroup.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.uploadpricegroup.name);
			}
		}
	},
	'coolerinventory': {
		'title': 	'Cooler Inventory',
		'name': 	'coolerinventory',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/coolerinventory.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#coolerinventoryframe')[0].src = dialogData.coolerinventory.dialogurl
				dialogName = dialogData.coolerinventory.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('coolerinventory');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.coolerinventory.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.coolerinventory.name);
			}
		}
	},
	'uploadcoolerinventory': {
		'title': 	'Upload Cooler Inventory',
		'name': 	'uploadcoolerinventory',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/uploadcoolerinventory.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#uploadcoolerinventoryframe')[0].src = dialogData.uploadcoolerinventory.dialogurl
				dialogName = dialogData.uploadcoolerinventory.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('uploadcoolerinventory');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.uploadcoolerinventory.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.uploadcoolerinventory.name);
			}
		}
	},
	'PDIbP': {
		'title': 	'Print Detailed Invoice by Period',
		'name': 	'PDIbP',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/PDIbP.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#PDIbPframe')[0].src = dialogData.PDIbP.dialogurl
				dialogName = dialogData.PDIbP.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('PDIbP');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.PDIbP.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.PDIbP.name);
			}
		}
	},
	'PIbM': {
		'title': 	'Print Invoice by Model',
		'name': 	'PIbM',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/PIbM.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#PIbMframe')[0].src = dialogData.PIbM.dialogurl
				dialogName = dialogData.PIbM.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('PIbM');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.PIbM.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.PIbM.name);
			}
		}
	},
	'PIbRT': {
		'title': 	'Print Invoice by Repair Type',
		'name': 	'PIbRT',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/PIbRT.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#PIbRTframe')[0].src = dialogData.PIbRT.dialogurl
				dialogName = dialogData.PIbRT.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('PIbRT');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.PIbRT.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.PIbRT.name);
			}
		}
	},
	'POSPpRN': {
		'title': 	'Print Repair Note Number',
		'name': 	'POSPpRN',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/POSPpRN.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#POSPpRNframe')[0].src = dialogData.POSPpRN.dialogurl
				dialogName = dialogData.POSPpRN.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('POSPpRN');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.POSPpRN.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.POSPpRN.name);
			}
		}
	},
	'PRNN': {
		'title': 	'Print Repair Note Number',
		'name': 	'PRNN',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/PRNN.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#PRNNframe')[0].src = dialogData.PRNN.dialogurl
				dialogName = dialogData.PRNN.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('PRNN');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.PRNN.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.PRNN.name);
			}
		}
	},
	'coolerinventorytable': {
		'title': 	'Display Cooler Inventory',
		'name': 	'coolerinventorytable',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/coolerinventory-table.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#coolerinventorytableframe')[0].src = dialogData.coolerinventorytable.dialogurl
				dialogName = dialogData.coolerinventorytable.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('coolerinventorytable');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.coolerinventorytable.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.coolerinventorytable.name);
			}
		}
	},
	'coolerinventorydeltable': {
		'title': 	'Return Cooler Inventory',
		'name': 	'coolerinventorydeltable',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/coolerinventorydel-table.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#coolerinventorydeltableframe')[0].src = dialogData.coolerinventorydeltable.dialogurl
				dialogName = dialogData.coolerinventorydeltable.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('coolerinventorydeltable');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.coolerinventorydeltable.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.coolerinventorydeltable.name);
			}
		}
	},
	'printsparepartsorder': {
		'title': 	'Print Spare Parts for Order',
		'name': 	'printsparepartsorder',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/printsparepartsorder.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#printsparepartsorderframe')[0].src = dialogData.printsparepartsorder.dialogurl
				dialogName = dialogData.printsparepartsorder.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('printsparepartsorder');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.printsparepartsorder.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.printsparepartsorder.name);
			}
		}
	},
	'maintainsparepartsorder': {
		'title': 	'Maintain Spare Parts Order',
		'name': 	'maintainsparepartsorder',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/maintainsparepartsorder.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#maintainsparepartsorderframe')[0].src = dialogData.maintainsparepartsorder.dialogurl
				dialogName = dialogData.maintainsparepartsorder.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('maintainsparepartsorder');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.maintainsparepartsorder.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.maintainsparepartsorder.name);
			}
		}
	},
	'addsporder': {
		'title': 	'Add Spare Parts Order',
		'name': 	'addsporder',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/addsporder.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#addsporderframe')[0].src = dialogData.addsporder.dialogurl
				dialogName = dialogData.addsporder.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('addsporder');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.addsporder.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.addsporder.name);
			}
		}
	},
	'printorderedsp': {
		'title': 	'Print Spare Parts Order',
		'name': 	'printorderedsp',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/printorderedsp.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#printorderedspframe')[0].src = dialogData.printorderedsp.dialogurl
				dialogName = dialogData.printorderedsp.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('printorderedsp');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.printorderedsp.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.printorderedsp.name);
			}
		}
	},
	'closeorderforsp': {
		'title': 	'Close Order for Spare Parts',
		'name': 	'closeorderforsp',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/closeorderforsp.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#closeorderforspframe')[0].src = dialogData.closeorderforsp.dialogurl
				dialogName = dialogData.closeorderforsp.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('closeorderforsp');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.closeorderforsp.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.closeorderforsp.name);
			}
		}
	},
	'printclosedordersforsp': {
		'title': 	'Print Closed Orders for Spare Parts',
		'name': 	'printclosedordersforsp',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/printclosedordersforsp.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#printclosedordersforspframe')[0].src = dialogData.printclosedordersforsp.dialogurl
				dialogName = dialogData.printclosedordersforsp.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('printclosedordersforsp');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.printclosedordersforsp.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.printclosedordersforsp.name);
			}
		}
	},
	'uploadsparepartsorder': {
		'title': 	'Upload Spare Parts Order',
		'name': 	'uploadsparepartsorder',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/uploadsparepartsorder.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#uploadsparepartsorderframe')[0].src = dialogData.uploadsparepartsorder.dialogurl
				dialogName = dialogData.uploadsparepartsorder.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('uploadsparepartsorder');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.uploadsparepartsorder.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.uploadsparepartsorder.name);
			}
		}
	},
	'uploadadjustment': {
		'title': 	'Upload Inventory Adjustment',
		'name': 	'uploadadjustment',
		'getid':	'',
		'created': 	false,
		'dialogurl':	'./iframe/uploadadjustment.html',
		'dialogSize':	{
			'width':	230,
			'top': 		0,
			'height':	200,
			'left':		0
		},
		'param':	{
			autoOpen:	true,
			minHeight:	60,
			open:		function (event, ui) {
				$('#uploadadjustmentframe')[0].src = dialogData.uploadadjustment.dialogurl
				dialogName = dialogData.uploadadjustment.name;
				getDialogSize(getUserId(), dialogName);
				window.setTimeout("updateDialog('uploadadjustment');", timeout);
			},
			dragStop:	function(event, ui) {
				updateSize(dialogData.uploadadjustment.name);
			},
			resizeStop: function(event, ui) {
				updateSize(dialogData.uploadadjustment.name);
			}
		}
	}
}

var update_api = {
	'mspdialog': {
		'model':		{
			'func':		'',
			'param':	'model'
		},
		'currency':	{
			'func':		'',
			'param':	'currency'
		},
		'unit':		{
			'func':		'',
			'param':	'unit'
		},
		'mspdialog':		{
			'func':		'',
			'param':	'mspdialog'
		}
	},
	'mrtform':	{
		'model':		{
			'func':		'',
			'param':	'mrtmodel'
		},
		'currency':	{
			'func':		'',
			'param':	'currency'
		}
	},
	'customergroup':	{
		'customergroup':		{
			'func':		'',
			'param':	'customergroup'
		}
	},
	'repairnotetable':	{
		'repairnotetable':		{
			'func':		'',
			'param':	'repairnotetable'
		}
	},
	'update':	function (name){
		if (update_api.mspdialog[name] != undefined){
			if (update_api.mspdialog[name].func != ''){
				update_api.mspdialog[name].func(update_api.mspdialog[name].param);
			}
		}
		if (update_api.mrtform[name] != undefined){
			if (update_api.mrtform[name].func != ''){
				update_api.mrtform[name].func(update_api.mrtform[name].param);
			}
		}
		if (update_api.customergroup[name] != undefined){
			if (update_api.customergroup[name].func != ''){
				update_api.customergroup[name].func(update_api.customergroup[name].param);
			}
		}
		if (update_api.repairnotetable[name] != undefined){
			if (update_api.repairnotetable[name].func != ''){
				update_api.repairnotetable[name].func(update_api.repairnotetable[name].param);
			}
		}
	}
};

function updateDialog(name){
	/*jqName = '#' + dialogData[name].name;
	jqNameFrame = jqName + 'frame';
	$(jqName).dialog('option', 'height', dialogData[name].dialogSize.height);
	$(jqName).dialog('option', 'width', dialogData[name].dialogSize.width);
	$(jqName).dialog('option', 'position', [dialogData[name].dialogSize.left, dialogData[name].dialogSize.top]);
	$(jqName)[0].style.height = dialogData[name].dialogSize.height - 40 + 'px';
	$(jqName)[0].style.width = dialogData[name].dialogSize.width - 28 + 'px';
	$(jqNameFrame)[0].style.height = "100%";
	$(jqNameFrame)[0].style.width = "100%";*/
}

function test(){
	var aaa = new Date();
	alert(aaa);
	alert(aaa.getTime());
}

function updateSize(name) {
	jqName = '#' + name;
	dialogData.mainmenudialog.dialogSize.width = $(jqName).dialog('option', 'width');
	dialogData.mainmenudialog.dialogSize.height = $(jqName).dialog('option', 'height');
	dialogData.mainmenudialog.dialogSize.left = $(jqName)[0].parentNode.style.left;
	dialogData.mainmenudialog.dialogSize.top = $(jqName)[0].parentNode.style.top;
	setDialogSize(getUserId(), name, dialogData.mainmenudialog.dialogSize);
}

function getDialogSize(userId, dialogName){
	$.ajax({
		type: "POST",
		url: "../../../bin/kernel.py?func=getSizeDialog",
		data: "userId=" + userId +'&dialogName=' + dialogName,
		success: function(msg){
			msg = eval('msg=' + msg);
			if (msg.width == 0) {
				setDialogSize(userId, dialogName, dialogData[dialogName].dialogSize);
			} else {
				msg.left = msg.left - 0;
				msg.top = msg.top - 0;
				msg.height = msg.height - 0;
				msg.width = msg.width - 0;
				dialogData[dialogName].dialogSize = msg;
			}
		}
	});
}

function getGETdata() {
	var tmp = new Array();
	var tmp2 = new Array();
	var param = new Array();

	var get = parent.location.search;

	if(get != '') {
		tmp = (get.substr(1)).split('&');
		for(var i=0; i < tmp.length; i++) {
			tmp2 = tmp[i].split('=');
			param[tmp2[0]] = tmp2[1];
		}
		return param
	}
}

function getUserId() {
	r = getGETdata()
	if (r != undefined){
		return getGETdata()['userId'];
	}
	return 'default';
}

function setDialogSize(userId, dialogName, cord){
	$.ajax({
		type: 	"POST",
		url: 	"../../../bin/kernel.py?func=setDialogSize",
		data: 	'userId=' + userId +
				'&dialogName=' + dialogName +
				'&left=' + cord.left +
				'&top=' + cord.top +
				'&width=' + cord.width +
				'&height=' + cord.height,
		success: function(msg){
			return msg
		}
	});
}

function update(obj, nameForm) {
	obj.xslt(xsltData[nameForm].xslturl, xsltData[nameForm].xmlurl);
}

function showDialog(name, id) {

	var lname = dialogData[name].name + '_setting';
	if (localStorage[lname] == 1) {
		var ww = localStorage[lname + '_width'] - 0 + 'px';
		var wh = localStorage[lname + '_height'] - 0 + 'px';
		var wl = localStorage[lname + '_left'] - 0 + 'px';
		var wt = localStorage[lname + '_top'] - 0 + 'px';
	} else {
		var ww = dialogData[name].dialogSize.width;
		var wh = dialogData[name].dialogSize.height;
		var wl = dialogData[name].dialogSize.left;
		var wt = dialogData[name].dialogSize.top;
	};

	if (dialogData[name].dialogurl != 'extjs') {

		Ext.create('Ext.window.Window',{
			title: dialogData[name].title,
			width: ww,
			height: wh,
			x: wl,
			y: wt,
			html: "<iframe id='" + name + "frame' width='100%' height='100%' frameborder='0' vspace='0' hspace='0' marginwidth='0' marginheight='0' style='position: absolute; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box;'></iframe>",
			listeners: {
				move: function (component, x, y, object) {
					localStorage[lname] = 1;
					localStorage[lname + '_left'] = x;
					localStorage[lname + '_top'] = y;
				},
				resize: function (component, width, height, object) {
					localStorage[lname] = 1;
					localStorage[lname + '_width'] = width;
					localStorage[lname + '_height'] = height;
				},
			},
		}).show();
	}

	dialogData[name].param.open();

/*	jqName = '#' + dialogData[name]['name'];
	if ($(jqName)[0] == undefined) {
		$("#dialogs").html(
			$("#dialogs").html() +
			"<div id='" + name +"'><iframe id='" + name + "frame' " +
			"width='100%' heigth='100%' frameborder='0' vspace='0' " +
			"hspace='0' marginwidth='0' marginheight='0'></iframe></div>"
		);
		if (dialogData[name]['scrolling'] != undefined) {
			$("#" + name + "frame").attr('scrolling', dialogData[name]['scrolling']);
		}
	}
	if (dialogData[name]['created'] == false) {
		if (dialogData[name]['param'] != undefined) {
			$(jqName).dialog(dialogData[name]['param']);
			$(jqName).dialog('option', 'title', dialogData[name]['title']);
			dialogData[name]['created'] = true;
		} else {
			$(jqName).dialog();
			dialogData[name]['created'] = true;
		}
	} else {
		$(jqName).dialog('open');
	}*/
}

/*
 * IE XML DOM OBJECT creating *
 */
function createMsxml2DOMDocumentObject() {
	var msxml2DOM
	var msxml2DOMDocumentVersions = new Array("Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.5.0","Msxml2.DOMDocument.4.0")
	for(var i=0; i<msxml2DOMDocumentVersions.length && !msxml2DOM; i++) {
		try {
			msxml2DOM = new ActiveXObject(msxml2DOMDocumentVersions[i])
		} catch(e){}
	}
	if(!msxml2DOM)
		alert("Visit pease \n http://msdn.microsoft.com/XML/XMLDownloads/default.aspx")
	else
		return msxml2DOM
 }
/*
 * Функции загрузки акций по дням *
 */
function xsltLoad(xslPath, xmlPath) {
	$.ajax({
		type: "GET",
		url: xslPath,
		success: function(msg){
			if(this.DOMParser) {
				var dp = new DOMParser()
				stylesheetDoc = dp.parseFromString(request.responseText,"text/xml")
			} else if(window.ActiveXObject) {
				stylesheetDoc = createMsxml2DOMDocumentObject()
				stylesheetDoc.async = false
				stylesheetDoc.load(request.responseXML)
			}
		}
	});

}

